import request from '@/axios';

export const getPropertyLatest = (deviceId) => {
  return request({
    url: '/blade-iot/device/sequence/property-latest',
    method: 'get',
    params: {
      deviceId
    }
  })
}

export const getCommandLatest = (deviceId) => {
  return request({
    url: '/blade-iot/device/sequence/command-latest',
    method: 'get',
    params: {
      deviceId
    }
  })
}

export const getEventLatest = (deviceId) => {
  return request({
    url: '/blade-iot/device/sequence/event-latest',
    method: 'get',
    params: {
      deviceId
    }
  })
}

export const getPropertyHistory = (current, size, params) => {
  return request({
    url: '/blade-iot/device/sequence/property-history',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getCommandHistory = (current, size, params) => {
  return request({
    url: '/blade-iot/device/sequence/command-history',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getEventHistory = (current, size, params) => {
  return request({
    url: '/blade-iot/device/sequence/event-history',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getLogMessage = (current, size, params) => {
  return request({
    url: '/blade-iot/device/log/message',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
